package com.kiss.fw.utils;

import javax.servlet.ServletException;
import javax.xml.ws.http.HTTPException;

import com.kiss.fw.exceptions.ActionException;
import com.kiss.fw.exceptions.ActionServletException;
import com.kiss.fw.exceptions.BusinessException;
import com.kiss.fw.exceptions.CommandException;
import com.kiss.fw.exceptions.CommandInitializeException;
import com.kiss.fw.exceptions.DAOException;
import com.kiss.fw.exceptions.MapperException;
import com.kiss.fw.exceptions.ObjectPoolInitializeException;
import com.kiss.fw.exceptions.ResourceNotFoundException;
import com.kiss.fw.exceptions.SQLSessionException;
import com.kiss.fw.exceptions.StoredProcedureException;
import com.kiss.fw.exceptions.ValidationException;

public interface Constants {
	public static interface Property {
		// Command properties
		public static final String COMMAND_CLASS = "command.class.";
		public static final String COMMAND_SINGLETON = "command.singleton.";
		public static final String COMMAND_CONTAINER = "command.container";
		
		// DAO properties
		public static final String DB_SCHEMA = "dao.dbSchema";
		public static final String MYBATIS_CONFIGURATION = "dao.configuration";
		public static final String MYBATIS_ENVIRONMENT = "dao.environment";
		
		// Object Pooling
		public static final String OBJECT_POOL_MAX_SIZE = "object.pool.size.max.";
		public static final String OBJECT_POOL_MIN_SIZE = "object.pool.size.min.";
		
		// Notifications
		public static final String NOTIFICATIONS_EMAIL = "notifications.email.";
		public static final String NOTIFICATIONS_TEXT = "notifications.text.";
		public static final String NOTIFICATIONS_EMAIL_JNDI = "notifications.email.jndi";
		public static final String NOTIFICATIONS_EMAIL_FROM = "notifications.email.from";
		public static final String NOTIFICATIONS_EMAIL_TO = "notifications.email.to";
		
		// Email
		public static final String EMAIL_JNDI = "email.jndi";
		
		// Misc
		public static final String FACEBOOK_APPID = "application.facebook.applicationId";
		public static final String GOOGLE_ANALYTICS = "application.google.analytics";
	}
	
	public static interface Mappings {
		// HTTP Request/Response Mappings
		public static final String WEB_ACTION = "action";
		public static final String CREATE_ACTION = "C";
		public static final String READ_ACTION = "R";
		public static final String UPDATE_ACTION = "U";
		public static final String DELETE_ACTION = "D";
		public static final String SEARCH_ACTION = "S";
		public static final String BROWSE_ACTION = "B";
	}
	
	public static interface Exceptions {
		public static final ActionException ACTION_EXCEPTION = new ActionException();
		public static final ActionServletException ACTION_SERVLET_EXCEPTION = new ActionServletException();
		public static final BusinessException BUSINESS_EXCEPTION = new BusinessException();
		public static final CommandException COMMAND_EXCEPTION = new CommandException();
		public static final CommandInitializeException COMMAND_INITIALIZE_EXCEPTION = new CommandInitializeException();
		public static final DAOException DAO_EXCEPTION = new DAOException();
		public static final MapperException MAPPER_EXCEPTION = new MapperException();
		public static final ObjectPoolInitializeException OBJECT_POOL_INITIALIZE_EXCEPTION = new ObjectPoolInitializeException();
		public static final ResourceNotFoundException RESOURCE_NOT_FOUND_EXCEPTION = new ResourceNotFoundException();
		public static final SecurityException SECURITY_EXCEPTION = new SecurityException();
		public static final ServletException SERVLET_EXCEPTION = new ServletException();
		public static final SQLSessionException SQL_SESSION_EXCEPTION = new SQLSessionException();
		public static final StoredProcedureException STORED_PROCEDURE_EXCEPTION = new StoredProcedureException();
		public static final ValidationException VALIDATION_EXCEPTION = new ValidationException();
		public static final HTTPException HTTP_400_EXCEPTION = new HTTPException(400);
		public static final HTTPException HTTP_403_EXCEPTION = new HTTPException(403);
		public static final HTTPException HTTP_404_EXCEPTION = new HTTPException(404);
		
		// this action exception basically refers to a "resource not found"
		public static final ActionException ACTION_404_EXCEPTION = new ActionException(HTTP_404_EXCEPTION);
	}
	
	public static interface Misc {
		public static final String EJB_CONTAINER = "ejb";
		public static final String WEB_CONTAINER = "web";
	}
}